# -*- mode: python ; coding: utf-8 -*-
import os
import flask_bootstrap

# 获取flask_bootstrap的模板目录路径
flask_bootstrap_template_path = os.path.join(os.path.dirname(flask_bootstrap.__file__), 'templates')

a = Analysis(
    ['manage.py'],
    pathex=[],
    binaries=[],
    datas=[
        (flask_bootstrap_template_path, 'flask_bootstrap/templates'),
        # 将配置文件复制到dist目录下
        ('./app/config.py', './'),
        ('./app/config_default.py', './'),
        ('./app/log.py', './')
    ],
    hiddenimports=[],
    hookspath=[],
    hooksconfig={},
    runtime_hooks=[],
    excludes=['config', 'config_default', 'log'],  # 排除这些模块，不打包到exe中
    noarchive=False,
    optimize=0,
)
pyz = PYZ(a.pure)
splash = Splash(
    'loading.png',
    binaries=a.binaries,
    datas=a.datas,
    text_pos=None,
    text_size=12,
    minify_script=True,
    always_on_top=True,
)

exe = EXE(
    pyz,
    a.scripts,
    a.binaries,
    a.datas,
    # splash,
    # splash.binaries,
    [],
    name='write_books',
    debug=False,
    bootloader_ignore_signals=False,
    strip=False,
    upx=True,
    upx_exclude=[],
    runtime_tmpdir=None,
    console=True,
    disable_windowed_traceback=False,
    argv_emulation=False,
    target_arch=None,
    codesign_identity=None,
    entitlements_file=None,
    icon=['favicon.ico'],
)
